Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add edition = "2018" to tokio-async-await #935

Closed
wants to merge 1 commit into from
Closed

Add edition = "2018" to tokio-async-await #935

wants to merge 1 commit into from

Conversation

galich
Copy link

@galich galich commented Feb 28, 2019

Motivation

Recently some of our builds started to fail with error in tokio-async-await (i suspect fresh nightly came out):

error[E0670]: async fn is not permitted in the 2015 edition

turns out this crate does not have 2018 edition requirement

Solution

add edition="2018"

Copy link
Member

@LucioFranco LucioFranco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to me 👍 I would say this crate is fine to expect people to be on the latest version of the compiler.

@carllerche
Copy link
Member

The reason I didn't set it to 2018 before was that it broke older cargo versions. Because tokio-async-await is in the workspace, if cargo did not understand the edition key, it would crash.

I'm not sure what changed to make CI pass, so I would do a bit more investigation first.

@galich
Copy link
Author

galich commented Feb 28, 2019

our CI system updated to the latest nightly and started to fail builds, it has to be something with today's nightly update

@galich
Copy link
Author

galich commented Feb 28, 2019

async fn map_ok<T: StdFuture>(future: T) -> Result<(), ()> {

I also can see async fn used in tokio crate, so i'd imagine similar issue there

@galich
Copy link
Author

galich commented Feb 28, 2019

my apologies, our original error came from the tokio crate itself, not just tokio-async-await

error[E0670]: `async fn` is not permitted in the 2015 edition
 --> ...\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-0.1.15\src\async_await.rs:3:1
  |
3 | async fn map_ok<T: StdFuture>(future: T) -> Result<(), ()> {
  | ^^^^^

nightly-x86_64-pc-windows-msvc rustc 1.34.0-nightly (7e001e5c6 2019-02-27)

@taiki-e
Copy link
Member

taiki-e commented Feb 28, 2019

The reason I didn't set it to 2018 before was that it broke older cargo versions. Because tokio-async-await is in the workspace, if cargo did not understand the edition key, it would crash.

Rust 1.26 does not know the edition key, so the build passes, but it fails on Rust 1.27-1.30.

@taiki-e
Copy link
Member

taiki-e commented Feb 28, 2019

Recently some of our builds started to fail with error in tokio-async-await (i suspect fresh nightly came out):

error[E0670]: async fn is not permitted in the 2015 edition

This change is due to rust-lang/rust#58678 and applies nightly-2019-02-28 (7e001e5c6 2019-02-27) or later.

@taiki-e
Copy link
Member

taiki-e commented Feb 28, 2019

Also, it cannot avoid this error by change tokio-async-await to 2018 edition (the current tokio-async-await does not have async fn, only tokio has async fn).

@carllerche
Copy link
Member

I think the only option here will be to remove usage of the async keyword in tokio proper...

@galich
Copy link
Author

galich commented Feb 28, 2019

tokio-await-async has some async fn in examples, perhaps it makes sense to keep it edition=2018
as for tokio itself - i think @carllerche solution is the lesser of all evils

@carllerche
Copy link
Member

Closing in favor of #940. Thanks for doing the initial debugging / work though 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants